<%@page import="cn.school.mybaits.entity.Grade"%>
<%@page import="java.util.List"%>
<%@page import="cn.school.mybaits.Dao.GradeDao"%>
<%@page import="cn.school.mybaits.xml.MyBatisUtil"%>
<%@page import="org.apache.ibatis.session.SqlSession"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
</head>
<body>
	<div>
		<form action="AddStudent.jsp" method="post">
			<p>
				<input type="text" name="sname" placeholder="学生姓名">
			</p>
			<p>
				<input type="radio" name="sex" value="男" checked="checked">男
				<input type="radio" name="sex" value="女" />女
			</p>
			<p>
				<input type="text" name="telephone" placeholder="号码">
			</p>
			<p>
				<input type="text" name="qq" placeholder="QQ">
			</p>
			<p>
				<input type="text" name="wechat" placeholder="微信">
			</p>
			<p>
				<%
					out.print("年级id");
					SqlSession se = MyBatisUtil.get();
					GradeDao gradeDao = se.getMapper(GradeDao.class);
					List<Grade> list = gradeDao.search();
					out.print("<select name='gradeid'>");
					for (Grade g : list) {
						out.print("<option value=" + g.getId() + ">" + g.getId() + "</option>");
					}
					out.print("</select>");
				%>
			</p>
			<p>
				<input type="text" name="enterdate" placeholder="入学日期">
			</p>
			<p>
				<input type="text" name="fromcity" placeholder="家乡">
			</p>
			<p>
				<input type="text" name="birthday" placeholder="生日">
			</p>
			<p>
				<input type="text" name="address" placeholder="地址">
			</p>
			<p>
				<input type="password" name="pass" placeholder="密码">
			</p>
			<p>
				<input type="submit" value="提交">
			</p>
		</form>
	</div>
</body>
</html>